PATHMac OS 8 and 9 Developer Documentation > Interapplication Communication > AppleScript for Scripters >

AppleScript Language Guide

   

Common Scripting Tasks

Table A-1 lists common scripting tasks and provides links to sections in this book with related sample scripts or overview material.

Table A-1   Links to sample scripts and other useful information 

Working With Applications

Launching an application Launch
Moving data from a database to a spreadsheet Repeat Until
Quitting an application Quit
Reopening an application Reopen
Running an application Run
Specifying an application on a remote machine References to Remote Applications

Working With Constants

Arithmetic, Boolean, Consider and Ignoring, Date and Time, Miscellaneous, Save Option, String, Text Style, and Version Constants

Working With Error Handling

Handling a User Cancelled error returned from the Display Dialog scripting addition command Try
Setting a timeout interval With Timeout
Using a Try statement to handle errors Error
(See also Miscellaneous Tasks in this table.)

Working With Files and Documents

Creating a new application document Make
Opening a file Open
Printing a document Print
Printing all open documents with a Repeat loop and Exit statement Exit
Saving a document Save
Searching for a string in a list of documents Examples of Subroutines With Labeled Parameters
Specifying a file by alias, by file specification, or by reference References to Files and Applications

Working With the Finder

Cleaning up a Finder window Dictionaries
Counting files in a folder Using Results
Counting files on a disk Count
Deleting a file on the startup disk Delete
Determining if a file exists Characteristics of Control Statements ;
If Statements
Determining if a folder exists Exists
Duplicating a file on the startup disk Duplicate
Examining files by file type Filter
Moving a file to a different folder Move
Opening all the aliases in a folder Figure 2-3
Opening files and folders by ID ID
Special disk and folder names the Finder understands ( control panels folder , startup disk , system folder , and others) Viewing a Result in the Script Editor's Result Window

Working With Handlers and Subroutines

Handling pathnames of files dropped on a script application Open Handlers
Working with libraries of subroutines Saving and Loading Libraries of Subroutines
Writing an idle handler Idle Handlers
Writing a minimum value subroutine A Sample Subroutine
Writing a quit handler Quit Handlers
Writing a recursive subroutine Recursive Subroutines

Working with references

Overview of references and containers References
Summary of reference forms Reference Forms
Working with reference filters Using the Filter Reference Form
Working with references to files and applications References to Files and Applications
Working with the Reference value class Reference

Working With the Script Editor

Compiling a script with the Script Editor Compiling Scripts With the Script Editor
Entering raw data in a script Entering Script Information in Raw Format
Examining an application's dictionary Dictionaries
Using comments in a script Comments
Using the Script Editor's Event Log window Debugging Scripts

Working With Text

Getting a paragraph of text Get
Moving text within a document Relative
Replacing text in a word processing document Styled Text
Styled Clipboard Text Styled Clipboard Text
Unicode and International Text Unicode Text and International Text

Working With Value Classes

Common value classes Table 3-1
Coercing values Coercing Values
Dates Date ;
Date-Time Arithmetic ;
Working With Dates at Century Boundaries
Measurements of length, area, cubic and liquid volume, mass, and temperature Unit Type Value Classes
RGB Colors RGB Color

Working With Windows

Closing a window Close
Closing a window on a remote computer Tell (Compound Statement)
Getting the screen position of a window Copy

Miscellaneous Tasks

Changing Text Item Delimiters AppleScript Properties
Comparing strings Greater Than, Less Than ;
Considering/Ignoring
Creating variables Creating Variables ;
Debugging a script Debugging Scripts
Getting and setting Clipboard data Styled Clipboard Text
Inserting and accessing items in large lists List ;
The A Reference To Operator
Rules for naming identifiers Identifiers
Scope of properties and variables Scope of Script Variables and Properties
Speaking text from a script Debugging Scripts
Working with script objects Script Objects


© 1999 Apple Computer, Inc. – (Last Updated 21 May 99)